package com.wayhome.springfarmework.core.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;

public class FileSystemResource implements Resource{

    private final File file;
    private final String filePath;

    public FileSystemResource(String filePath){
        this.filePath = filePath;
        this.file = new File(filePath);
    }
    public FileSystemResource(String filePath, File file){
        this.filePath = filePath;
        this.file = file;
    }
    public final String getFilePath() {
        return this.filePath;
    }

    @Override
    public InputStream getInputStream() throws IOException {

        return new FileInputStream(file);
    }
}
